dax

Creating a Measure that returns DISTINCT COUNT by Country and Brand in Power BI

醉酒当歌 提交于 2021-02-07 19:14:45
问题 I have a table like below: Country, Advertiser, Brand, Spend C1, A1, B1, 10 C1, A1, B2, 5 C1, A2, B3, 0 C1, A2, B4, 20 C2, A1, B1, 8 C2, A1, B5, 7 C2, A2, B6, 4 C2, A2, B3, 3 C2, A2, B7, 2 C2, A3, B8, 9 I'd like to get the DISTINCT COUNT of Brands by Country, which is simply: C1 => 4 C2 => 6 How do I create a measure in Power BI that I can embed in a table or a tree-map? I have already tried this: Measure = COUNTX(DISTINCT(sourceTable),sourceTable[Brand]) which returns total Brand count (not

Creating a Measure that returns DISTINCT COUNT by Country and Brand in Power BI

旧街凉风 提交于 2021-02-07 19:11:41
问题 I have a table like below: Country, Advertiser, Brand, Spend C1, A1, B1, 10 C1, A1, B2, 5 C1, A2, B3, 0 C1, A2, B4, 20 C2, A1, B1, 8 C2, A1, B5, 7 C2, A2, B6, 4 C2, A2, B3, 3 C2, A2, B7, 2 C2, A3, B8, 9 I'd like to get the DISTINCT COUNT of Brands by Country, which is simply: C1 => 4 C2 => 6 How do I create a measure in Power BI that I can embed in a table or a tree-map? I have already tried this: Measure = COUNTX(DISTINCT(sourceTable),sourceTable[Brand]) which returns total Brand count (not

Creating a Measure that returns DISTINCT COUNT by Country and Brand in Power BI

强颜欢笑 提交于 2021-02-07 19:10:15
问题 I have a table like below: Country, Advertiser, Brand, Spend C1, A1, B1, 10 C1, A1, B2, 5 C1, A2, B3, 0 C1, A2, B4, 20 C2, A1, B1, 8 C2, A1, B5, 7 C2, A2, B6, 4 C2, A2, B3, 3 C2, A2, B7, 2 C2, A3, B8, 9 I'd like to get the DISTINCT COUNT of Brands by Country, which is simply: C1 => 4 C2 => 6 How do I create a measure in Power BI that I can embed in a table or a tree-map? I have already tried this: Measure = COUNTX(DISTINCT(sourceTable),sourceTable[Brand]) which returns total Brand count (not

Creating a Measure that returns DISTINCT COUNT by Country and Brand in Power BI

 ̄綄美尐妖づ 提交于 2021-02-07 19:08:35
问题 I have a table like below: Country, Advertiser, Brand, Spend C1, A1, B1, 10 C1, A1, B2, 5 C1, A2, B3, 0 C1, A2, B4, 20 C2, A1, B1, 8 C2, A1, B5, 7 C2, A2, B6, 4 C2, A2, B3, 3 C2, A2, B7, 2 C2, A3, B8, 9 I'd like to get the DISTINCT COUNT of Brands by Country, which is simply: C1 => 4 C2 => 6 How do I create a measure in Power BI that I can embed in a table or a tree-map? I have already tried this: Measure = COUNTX(DISTINCT(sourceTable),sourceTable[Brand]) which returns total Brand count (not

DAX : Allocate Inventory to Open Orders

╄→гoц情女王★ 提交于 2021-02-05 11:45:28
问题 I am trying to allocate inventory items to open orders in DAX, PowerBi. The idea is to allocate all the available inventory to the oldest order first, then allocate the remaining inventory to the second oldest, etc. until the inventory is depleted. The inventory can be depleted even if the open order is not completely satisfied. Please check the attached picture as an example for the allocations below I tried adding a column in the open order table using the Calculate function but the results

Power BI, DAX, Many-to-one and relational tables

£可爱£侵袭症+ 提交于 2021-02-05 09:11:35
问题 I previously asked a question here: DAX subquery measure? for instruction on how to create a specific measure column for a visualisation. To keep the example simple, I kept it to one fictitious table and the DAX query worked really well. In reality, however, the visualisation that the measure column is for is made up of multiple joined tables. And the results of the DAX query unexpectedly produced all zeros! So I'll refactor my example here for more help... Requirement I want a count of how

Power BI, DAX, Many-to-one and relational tables

余生颓废 提交于 2021-02-05 09:11:10
问题 I previously asked a question here: DAX subquery measure? for instruction on how to create a specific measure column for a visualisation. To keep the example simple, I kept it to one fictitious table and the DAX query worked really well. In reality, however, the visualisation that the measure column is for is made up of multiple joined tables. And the results of the DAX query unexpectedly produced all zeros! So I'll refactor my example here for more help... Requirement I want a count of how

Power BI DAX : Get sum of a column based on another

房东的猫 提交于 2021-02-05 06:49:46
问题 Let say I have the folowwing table : Client Sales A 1000 A 100 A 10 B 1000 B 10 C 1 I would like to add another column Names TotalClient at the end which would the new table look like this : Client Sales Total A 1000 1110 A 100 1110 A 10 1110 B 1000 1010 B 10 1010 C 1 1 Is this possible either in DAX or in the query editor ? I tried many ways, but still can't figure out how. I was able to get information I needed using the SUMMARIZE function to get another table, but I run into other problem

Power BI DAX : Get sum of a column based on another

馋奶兔 提交于 2021-02-05 06:48:46
问题 Let say I have the folowwing table : Client Sales A 1000 A 100 A 10 B 1000 B 10 C 1 I would like to add another column Names TotalClient at the end which would the new table look like this : Client Sales Total A 1000 1110 A 100 1110 A 10 1110 B 1000 1010 B 10 1010 C 1 1 Is this possible either in DAX or in the query editor ? I tried many ways, but still can't figure out how. I was able to get information I needed using the SUMMARIZE function to get another table, but I run into other problem

Power BI DAX summarize and filter by date

﹥>﹥吖頭↗ 提交于 2021-01-29 16:32:08
问题 I have a Power BI report and I want to find the last date some action took place that had a non-0 value. In the following example: |-------------|------------| | ActionDate | ActionAmt| |-------------|------------| | 1-Feb | -100 | |-------------|------------| | 1-Feb | 100 | |-------------|------------| | 10-Jan | 150 | |-------------|------------| I want to return the 10-Jan date, not 1-Feb, since 10-Jan is the first non-0 value summed by ActionDay. My code returns 1-Feb: Last Action Date =