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, can anyone help me on this....
I need to create a metric for counting the number of months in range of Date(month) field at customer level for selected customers on selected months in the filtered table.
In the attached example the number of months is 2 for Customer 1, the Max Date is November and the min Date is October. It would be needed to consider End of Month in max Date.
Thanks in advance for any tip.
regards.
Solved! Go to Solution.
Hi, thanks for your answer but it doesn't work in my case.
I need to eliminate filter context in the table to be able to use a Dax like this example :
Hi, @arlequin71
Based on the above information, to get the Month column using the following measure
Count Months =
CALCULATE (
DISTINCTCOUNT ( 'Total Sales by Date by Dept'[Date(month)] ),
FILTER (
ALLSELECTED ( 'Total Sales by Date by Dept' ),
'Total Sales by Date by Dept'[CUST_NM]
= MAX ( 'Total Sales by Date by Dept'[CUST_NM] )
)
)
Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @arlequin71
Based on the above information, to get the Month column using the following measure
Count Months =
CALCULATE (
DISTINCTCOUNT ( 'Total Sales by Date by Dept'[Date(month)] ),
FILTER (
ALLSELECTED ( 'Total Sales by Date by Dept' ),
'Total Sales by Date by Dept'[CUST_NM]
= MAX ( 'Total Sales by Date by Dept'[CUST_NM] )
)
)
Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Thank you very much for your answer.
It works!.
"It would be needed to consider End of Month in max Date"
Not really. All you need is DISTINCTCOUNT(FORMAT([date],"yyyymm"))
Hi, thanks for your answer but it doesn't work in my case.
I need to eliminate filter context in the table to be able to use a Dax like this example :
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 |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |