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.
Hello everyone.
This is my first post so I'll try to question clearly my doubt.
I want to count the frequency an item has been sold throughout the year.
In this example:
I want to build up a DAX to get the 'MONTH_COUNT' as a frequency.
Prod1 has been sold in Jan,Mar and Apr. So 3/4 = 75%
So on and so forth.
Its not important the quantity, just if It was sold or not and count how many times during the year (Jan-Dec).
Thanks in advance
Solved! Go to Solution.
Hi @Anonymous ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Count_Month_Group =
CALCULATE(COUNT('Table'[group]),FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[group]=MAX('Table'[group])))
MONTH_COUNT =
CALCULATE(DISTINCTCOUNT('Table'[Month]),FILTER(ALL('Table'),'Table'[group]=MAX('Table'[group])))
Count_all = CALCULATE( DISTINCTCOUNT('Table'[Month]),ALL('Table'))
Divide =
IF(
ISINSCOPE( 'Table'[Month]),
[Count_Month_Group],
FORMAT( DIVIDE([MONTH_COUNT],[Count_all]),"Percent"))
2. Open the matrix vision object.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Count_Month_Group =
CALCULATE(COUNT('Table'[group]),FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[group]=MAX('Table'[group])))
MONTH_COUNT =
CALCULATE(DISTINCTCOUNT('Table'[Month]),FILTER(ALL('Table'),'Table'[group]=MAX('Table'[group])))
Count_all = CALCULATE( DISTINCTCOUNT('Table'[Month]),ALL('Table'))
Divide =
IF(
ISINSCOPE( 'Table'[Month]),
[Count_Month_Group],
FORMAT( DIVIDE([MONTH_COUNT],[Count_all]),"Percent"))
2. Open the matrix vision object.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you very much for the solution @v-yangliu-msft . It worked pretty well here and solved my problem!
Thanks for sharing the pbix
Best regards
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 |
---|---|
107 | |
98 | |
78 | |
65 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |