Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone,
my issue is that I have this measure:
Test Conteggio =
IF(
CALCULATE(
DISTINCTCOUNT(Calendario[Settimana]),DATESBETWEEN(Calendario[Date],STARTOFMONTH(Calendario[Date]),ENDOFMONTH(Calendario[Date])
)
) > = 6, 8, 6)
that returns a numerical value to changes in the number of weeks within a month.
So, when I filter for a single month, the measure returns the expected result.
Ex:
But, when I try to remove the filter "Anno, Mese", the measure doesn't work correctly and doesn't return the expected result.
I would like to have the overall sum of the measure for all the months.
According to the expected result, I should have 24 and not 8.
Thanks,
Domenico.
Solved! Go to Solution.
HI @Anonymous,
According to your description, it seems like measure total level calculation issues when you try to apply multiple aggregates.
For this scenario, I'd like to suggest you take a look at the following blog and it told about how to resolve this issue:
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
HI @Anonymous,
According to your description, it seems like measure total level calculation issues when you try to apply multiple aggregates.
For this scenario, I'd like to suggest you take a look at the following blog and it told about how to resolve this issue:
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
@Anonymous , Try like
Test Conteggio =
var _max = eomonth(maxx(allselected('Calendario'), 'Date'[Date]),0)
var _min= eomonth(minx(allselected('Calendario'), 'Date'[Date]),-1)+0
IF(
CALCULATE(
DISTINCTCOUNT(Calendario[Settimana]),DATESBETWEEN(Calendario[Date],_min,_max
)
) > = 6, 8, 6)
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi, thank you for your reply.
I've just tried to use the measure you suggested me but the formula doesn't work correctly.
I try to better explain the data and the sample.
There is a table that contains sales orders. I want to count the number of distinct orders in the table (I do this by checking count (distinct) from the "values" field) and compare it to a hypothetical number of orders that depends on the number of weeks in a month. I used the "Test Conteggio" measure mentioned before to calculate the hypothetical number of orders, but when filtering the table for a given set of months, the measure doesn't consider the sum of the hypothetical orders in filtered periods.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
119 | |
83 | |
47 | |
42 | |
33 |
User | Count |
---|---|
190 | |
78 | |
72 | |
54 | |
45 |