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,
I would need your help on one issue I am able to solve in m language but I would like to do in DAX :
Previousmonth variation product2 = SUM(Sheet1[Product 2])-calculate(sum(Sheet1[Product 2]),PREVIOUSMONTH('Calendar'[Date].[Date]))
I am able to display the TOPN variation of each product individually by applying TOPN filter on my Table, however, I would like to get the TOPN for all the products altogether. For example, for February, I would like to get for TOP 5 variations :
I found a way to do it in m language, but guess it would be less time processing and more evolutive by doing it in DAX.
For information, the way I can do it in m is:
Solved! Go to Solution.
Hi, @didi42 ;
You could try to create a table.
New table =
var _a=SUMMARIZE('Table',[Store],[Explanation],"Variation",[Product 1],"Product","Product1")
var _b=SUMMARIZE('Table',[Store],[Explanation],"Variation",[Product2],"Product","Product2")
var _c=SUMMARIZE('Table',[Store],[Explanation],"Variation",[Product3],"Product","Product3")
return TOPN(5, union(_a,_b,_c),[Variation],DESC)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @didi42 ;
You could try to create a table.
New table =
var _a=SUMMARIZE('Table',[Store],[Explanation],"Variation",[Product 1],"Product","Product1")
var _b=SUMMARIZE('Table',[Store],[Explanation],"Variation",[Product2],"Product","Product2")
var _c=SUMMARIZE('Table',[Store],[Explanation],"Variation",[Product3],"Product","Product3")
return TOPN(5, union(_a,_b,_c),[Variation],DESC)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you share some actual sample data to work on?
Proud to be a Super User!
Paul on Linkedin.
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 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |