Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi! I'd like to count the number of months over a target margin but the measure I wrote is giving me an error:
Months over Target Margin =
VAR Target =
DIVIDE(
[2022 Total Amount Converted] - [2022 Total Costs], [2022 Total Amount Converted]
)
return
CALCULATE(
COUNTA('Calendar'[Month]),
Target >= .5
)
I'm pretty new to DAX so any help is appreciated!
@Arete , Try like
Months over Target Margin =
VAR Target =
DIVIDE(
[2022 Total Amount Converted] - [2022 Total Costs], [2022 Total Amount Converted]
)
return
CALCULATE(
COUNTROWS(Filter(Values('Calendar'[Month]),Target >= .5))
)
Thanks for the reply! It looks like it's working but I need the discount count of months:
It should be 7 but instead, it says 13. Any suggestions?
User | Count |
---|---|
128 | |
109 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |