Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 69 | |
| 39 | |
| 35 | |
| 23 |