Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi everyone,
I found some unexpected results using a YEAR filter in a very simple case. Here is the data table:
I defined 2 measures :
Total_Order = SUM(OrderBook[OrderValue])
Cumul =
VAR CurrentTotal = SUM(OrderBook[OrderValue])
RETURN
CALCULATE(SUM(OrderBook[OrderValue]),
FILTER(ALLSELECTED(OrderBook[Supplier]), CALCULATE(SUM(OrderBook[OrderValue])) >= CurrentTotal))
Time Intelligence Auto Date/Time : is ACTIVATED (per default, on global and current file), allowing to use YEAR from date hierarchy.
Using the date visual filters :
With OrderDate=10/03/2022 and 15/08/2022 as expected, 2 rows
With Year=2022, it shows 4 rows, which is not what I expected (I expected only the 2 rows of 2022, so corresponding to supplier1 and supplier2). So strange !
But removing the measure "Cumul" from the visual, working as expected: 2 rows (behaving the same with either OrderDate or Year filter)
DOWNLOAD here: Exemple CUMUL RANKX - 1.pbix
What is wrong ? Is there something with the measure "Cumul" or some PBI parameters which I am unaware of ?
Thanks for your lights.
Hi everyone, that's it. No worry that for such simple test case, a combination of hierachy YEAR filter and a measure provides weird results ? is there a website where I shall adress the point ?
Hi @paul_marcault ,
Looks like CurrentTotal in second measure will also be filtered by allselected() function, you could take a check.
Best Regards,
Jay
Hi Jay, thanks for your reply. (you can play with the file which I made available for download)
To reply to your point: If CurrentTotal was applied ALLSELECTED, then the Cumul calculation would be wrong (it would be constant for each row and equal to the Sum of all OrderValue
and CurrentTotal is set to VAR outside the iteration where ALLSELECTED is used in FILTER(ALLSELECTED(OrderBook[Supplier]). But here the Cumul calculation are correct.
Just look at the difference when you use only the visual filter OrderDate=10/03/2022 and 15/08/2022
and compare when you use only the visual filter YEAR=2022. We shall expect the same results .
The case is so simple, but so strange indeed.
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |