Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello all,
Below are the two tables I have in my model (Fact and Dim). The join between the two tables is based on ID.
Fact Table | ||
ID | Total | Stop |
100 | 3 | 1 |
200 | 5 | 2 |
300 | 4 | 3 |
400 | 1 | 4 |
Dim | |
ID | Name |
100 | AA |
200 | BB |
300 | CC |
400 | DD |
Output :
Output | |||
Stop | Name | Total | Running Total |
1 | AA | 3 | 3 |
2 | BB | 5 | 8 |
3 | CC | 4 | 12 |
4 | DD | 1 | 13 |
I got the running total working using the below formula but it works as long as I have columns from Fact table ONLY. As soon as I place column from Dim table (i.e Name) the running total stops working and it displays the actual totals instead.
RT = CALCULATE(SUM(Table[Fact Table]),filter(allselected(Fact Table),Fact Table[Stop] <=max(Fact Table[Stop])))
I think I need to extend my DAX further and add Dim table to above formula but I am struck how this can be done. Can anyone please help on this. Thank you.
Solved! Go to Solution.
Hi @camargos88 ,
Based on the data and formula you currently provide, it can return the correct value. Could you please provide some screen shots about the below scenario? We need this information to see if we missed anything...
As soon as I place column from Dim table (i.e Name) the running total stops working and it displays the actual totals instead.
Best Regards
Rena
Hi @camargos88 ,
Based on the data and formula you currently provide, it can return the correct value. Could you please provide some screen shots about the below scenario? We need this information to see if we missed anything...
As soon as I place column from Dim table (i.e Name) the running total stops working and it displays the actual totals instead.
Best Regards
Rena
Hi @v-yiruan-msft and @camargos88
Thanks for you inputs. Actually upon investigation found that the join between fact and dim is many to many which is causing the issue. There are some duplicates in dim table which we removed from backend table and the formula that I posted worked without any issues. Thanks again it was backend table issue at the end.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
67 | |
62 |
User | Count |
---|---|
145 | |
111 | |
104 | |
84 | |
64 |