The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have got a table with Sales LY and this year sales looking like:
Month Sales LY Sales TY DIF
Jan 100 150 50
Feb 150 130 -20
Mar 200 50 -150
Apr 100
Total 550 330 -220
I have made the "DIF" column only calculate the difference when Sales TY is not blank. However, the total row calculates the total difference of all the rows, including those with blank Sales TY.
How can I only show the total for the "visible" values in the table? So, the above table should look like:
Month Sales LY Sales TY DIF
Jan 100 150 50
Feb 150 130 -20
Mar 200 50 -150
Apr 100
Total 550 330 -120
Hope you can help 🙂
HI @Anonymous ,
You can create 2 measures
Difference =
IF(MAX('Table'[Sales TY]) = BLANK(), BLANK() ,SUM('Table'[Sales LY]) - SUM('Table'[Sales TY]))
DIF = SUMX('Table',[Difference])
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
@Anonymous , assuming these are measures [Sales TY] , [Sales LY]
New measures like this should work
if(isblank([Sales TY]), blank(), [Sales TY] -[Sales LY])
Thank you @amitchandak
However, they are not measures...
Maybe its easier if i somehow make them into a measure?
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |