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.
I have a matrix that looks like the following:
Thanks to @About v-lionel-msft - Microsoft Power BI Community, I found a formula to calculate the difference rather than the total.
However, my problem now is that when I add a grouping category (from another table) to the rows it repeats all the paycodes and does not recognize the group.
Can anyone give me an idea of how to fix the below formula so that the YoY difference will recognize the grouping?
Thank you!
Hi @JKG ,
Not certain what is the relationship between your another table and this sample table, please check whether you have enabled 'show item with no data' first.
Then I noticed that each total value is wrong when you add the type field to the matrix, based on my test sample, you can try to modify the measure like this:
m =
VAR x =
CALCULATE (
SUM ( 'Pilpt Payroll Detail'[Total_CHs_Paid] ),
FILTER (
ALL ( 'Pilpt Payroll Detail' ),
'Pilpt Payroll Detail'[BidMnth] < MAX ( 'Pilpt Payroll Detail'[BidMnth] )
&& 'Pilpt Payroll Detail'[PayCode] IN DISTINCT ( 'Pilpt Payroll Detail'[PayCode] )
)
)
VAR y =
CALCULATE (
SUM ( 'Pilpt Payroll Detail'[Total_CHs_Paid] ),
FILTER (
ALL ( 'Pilpt Payroll Detail' ),
'Pilpt Payroll Detail'[BidMnth] = MAX ( 'Pilpt Payroll Detail'[BidMnth] )
&& 'Pilpt Payroll Detail'[PayCode] IN DISTINCT ( 'Pilpt Payroll Detail'[PayCode] )
)
)
RETURN
IF (
HASONEFILTER ( 'Pilpt Payroll Detail'[BidMnth] ),
SUM ( 'Pilpt Payroll Detail'[Total_CHs_Paid] ),
IF ( ISINSCOPE ( 'Table'[Type] ), y - x, y - x )
)
Attached my sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I tried your solution and it is very close to working. The categories show up correctly, but now the total is picking up the difference of the category for the entire data set rather than for the filtered months.
Hi @JKG ,
Could you please consider sharing a simple sample file without any sesentive information for further discussion?
Best Regards,
Community Support Team _ Yingjie Li
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 |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |