Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi PBI community, Im new in DAX and I hope you can help me
I have 3 tables, A SellOut table, a Information Company Table and a Calendar Table
I've created a measure with switch:
Classification = SWITCH(TRUE(),
[%Avrg]>=0.8,"A",
[%Avrg]>=0.6,"B",
[%Avrg]<0.6,"C",
"Otro")
Then I put in a matrix visualization and works well but I need to count the Classification and put it in a pie chart
| Company | %Avrg | Classification |
| Store1 | 0.9 | A |
| Store2 | 0.5 | C |
| Store3 | 0.4 | C |
So I tried to put that measure as a column but it give me incorrect results
The measure %Avrg
%Avrg= CALCULATE(DIVIDE([Actual_Month_Avrg],[Last_Month_Avrg],1))
Actual_Month_Avrg= CALCULATE(DIVIDE([Sales],[Days_Use]))
Last_Month_Avrg= CALCULATE(DIVIDE([Sales],[Days_Use]),DATEADD(CalendarTable[Date],-1,MONTH))
Sales= Sum(Sell_Out[Sales])
Days_Use= DISTINCTCOUNT(Sell_Out[Date])
thanks in advance
Hi @oromerot ,
You can create a table2 like :
Then you can use the following measure to count Classification:
Measure =
CALCULATE (
DISTINCTCOUNT ( Table[Company] ),
FILTER ( Table, [Classification] = MAX ( Table2[Classification] ) )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@oromerot , Create a table class with three values A,B,C, you can create using enter data.
then try a measure like
measure =
var _cal =Classification = SWITCH(TRUE(),
[%Avrg]>=0.8,"A",
[%Avrg]>=0.6,"B",
[%Avrg]<0.6,"C",
"Otro")
return
calculate(countrows(Table[Company]), values(Table[Company]) filter(Table, _cal = max(class[Class])))
refer these
https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-size-of-bi...
https://www.credera.com/blog/technology-solutions/creating-aging-report-using-a-user-selected-date-i...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 38 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 34 | |
| 32 | |
| 29 |