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.
Hi,
help needed with DAX.
i have the fllowing table with product, month and result columns available. But i need to create trend and previous month result columns based on month and result columns using dax.
Please let me know how to do it.
Thanks
Solved! Go to Solution.
@NPK,
Please review my PBIX file.
https://1drv.ms/u/s!AhsotbnGu1NogywooC50WnB9h2pJ
Regards,
Lydia
@NPK,
Create the following columns in your table.
Index = COUNTROWS(FILTER(Table1,Table1[Product]=EARLIER(Table1[Product])&&Table1[Month]<=EARLIER(Table1[Month])))
Previous month result = CALCULATE(FIRSTNONBLANK(Table1[Result],1),FILTER(Table1,Table1[Product]=EARLIER(Table1[Product]) && Table1[Index]=EARLIER(Table1[Index])-1))
Trend = IF(ISBLANK(Table1[Previous month result]),BLANK(), SWITCH( TRUE(), (Table1[Result]-Table1[Previous month result]) <= 0, UNICHAR(128315), (Table1[Result]-Table1[Previous month result]) >= .010,UNICHAR(9650), BLANK() ))
Regards,
Lydia
Thanks v-yuezhe-msft for your quick response.
I exactly followed your steps, but i'm getting blank rows, am i missing something?
T
Thank you
@NPK,
Please review my PBIX file.
https://1drv.ms/u/s!AhsotbnGu1NogywooC50WnB9h2pJ
Regards,
Lydia
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |