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 there!
I am struggling with my DAX syntax and was hoping that someone could help me.
I have a measure which counts rows but includes a filter option
Solved! Go to Solution.
Hi @SteveODea
What @Greg_Deckler said or adjust your syntax to.
%cOUNT =
DIVIDE(
CALCULATE(
DISTINCTCOUNT( 'Table1'[Ref] ),
LEFT( 'Table1'[Desc], 3 ) <> "Acc"
),
CALCULATE(
DISTINCTCOUNT( 'Table1'[Ref] ),
ALL( 'Table1' ),
LEFT('Table1'[Desc],3) <> "Acc"
)
)
Hi @SteveODea
What @Greg_Deckler said or adjust your syntax to.
%cOUNT =
DIVIDE(
CALCULATE(
DISTINCTCOUNT( 'Table1'[Ref] ),
LEFT( 'Table1'[Desc], 3 ) <> "Acc"
),
CALCULATE(
DISTINCTCOUNT( 'Table1'[Ref] ),
ALL( 'Table1' ),
LEFT('Table1'[Desc],3) <> "Acc"
)
)
Thanks @Mariusz you're a legend!
I wasn't sure where to put the ALL function, and even now I know where it should go I don't really understand it, but it works!
I guess that's a battle for another day.
I also changed ALL to ALLSELECTED as I have some filters on the page but it's what I want and I have full control over the formatting too!
Cheers buddy!
Try click the drop down arrow for the field in the Values area and choose Show As | Percent of Grand Total or Percent of Row/Column Total.
Great thanks @Greg_Deckler that's a useful tip to know, which works.
The only problem I have now is I cannot format the %age as shown. All the percentages show with 2 decimal places but I am unable to change this.
I have tried selecting "Value Decimal Places" under Field Formatting in the Format Tile, but it appears to be stuck on "Auto"
Any ideas how to change this?
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |