The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
79 | |
76 | |
46 | |
39 |
User | Count |
---|---|
143 | |
115 | |
64 | |
64 | |
53 |