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 |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |