Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
Hi experts,
I have this specific model to see the total of materials by class:
Where:
d_klah_classe.CLASS_classe: Field type text
[total_materiais]: DAX measure - "DISTINCTCOUNT(d_mara_material[MATNR_n_material])"
I want to create a pareto model, than I just created a DAX measure to give me the cumulative of column [total_materiais], but the problem comes when the value of next line in that column is the same, see:
The result I expect:
Could you help me to correct the DAX measure (bellow)?
FYI: The field "Class" will never repeat, so, maybe it can be used to to some comparison on the new fórmula. I do not know how to do ;(
Solved! Go to Solution.
Cumulative Material =
var c = max(data[Class])
var sm = count(data[Material])
var s = SUMMARIZE(ALLSELECTED(data),[Class],"sm",count(data[Material]))
var s1 = filter(s,[sm]>sm || ([sm]=sm && [Class]<=c))
return if(hasonevalue(data[Class]),sumx(s1,[sm]),sumx(s,[sm]))
see attached
@humbertovianabr You can also leverage the new WINDOW function, here is a video on my channel showing how this can be done: How new WINDOW DAX functions and PARTITIONBY helped to get the running total in Power BI - Part 2 - ...
👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
Share the download link of your PBI file.
Cumulative Material =
var c = max(data[Class])
var sm = count(data[Material])
var s = SUMMARIZE(ALLSELECTED(data),[Class],"sm",count(data[Material]))
var s1 = filter(s,[sm]>sm || ([sm]=sm && [Class]<=c))
return if(hasonevalue(data[Class]),sumx(s1,[sm]),sumx(s,[sm]))
see attached
The field "Class" will never repeat, so, maybe it can be used to to some comparison on the new fórmula.
You're on the right track. Add a filter that uses that field as an alphabetical sorter.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
78 | |
76 | |
70 | |
49 | |
42 |
User | Count |
---|---|
62 | |
40 | |
32 | |
30 | |
29 |