Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
164 | |
84 | |
68 | |
68 | |
58 |