Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Good morning Power-BI lovers! I've got a question for you all. Lets suppose i have the following example table:
Right now it shows the ammount of connections for each version each different month.
I want to change it so the numbers shown will be the difference between the column month and the previous one, something like
Version July August September
2.1.0 +4 +1 -5
2.1.1 +56 +15 -18
3.5 +102 -5 -60
Any thoughs?
Solved! Go to Solution.
Hi @markhop1 ,
1. Add a conditional column.
2. Create measures.
LastMonthValue = VAR CurrentMonth = MAX ( 'Table'[MonthNo.] ) RETURN IF ( MAX ( 'Table'[MonthNo.] ) = CALCULATE ( MIN ( 'Table'[MonthNo.] ), ALL ( 'Table' ) ), 0, CALCULATE ( MAX ( 'Table'[Value] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Version] ), 'Table'[MonthNo.] = CurrentMonth - 1 ) ) )
Difference = FORMAT(MAX('Table'[Value])-[LastMonthValue],"+0;-0")
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @markhop1 ,
1. Add a conditional column.
2. Create measures.
LastMonthValue = VAR CurrentMonth = MAX ( 'Table'[MonthNo.] ) RETURN IF ( MAX ( 'Table'[MonthNo.] ) = CALCULATE ( MIN ( 'Table'[MonthNo.] ), ALL ( 'Table' ) ), 0, CALCULATE ( MAX ( 'Table'[Value] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Version] ), 'Table'[MonthNo.] = CurrentMonth - 1 ) ) )
Difference = FORMAT(MAX('Table'[Value])-[LastMonthValue],"+0;-0")
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @Icey , thanks for pointing that out.
I'm actually not so good at DAX and, while I understand the idea of this function, I'm not able to make it work.
I've checked DAX documentation and it seems that CALCULATE uses ; to separate statements, maybe thats a typo in your solution?
I will post below my DAX function errrors, in case it helps you to point out what I am doing wrong
Also, I'm attaching how my table looks right now. 'Values' is the count of rows grouped by Version and Month
I will keep trying to modify it. If I find out what am I doing wrong I will post about it!
Thanks a lot, regards
Mark.
Hi @markhop1 ,
Maybe you can manually enter this formula in Power BI. Sometimes this issue will disappear after this operation.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Mark
If the columns of your dataset are static, then why not just create columns that calculate the difference between the months? That way you also don't overwrite existing data, which is best practise.
Let me know if this helps?
User | Count |
---|---|
95 | |
86 | |
78 | |
72 | |
67 |
User | Count |
---|---|
110 | |
104 | |
84 | |
65 | |
63 |