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
Hello Guys,
I am using an excel file as my data source. I am working with my table product at the moment specifically with the fields Sales Revenue and States. I want to create a new measure on that table that will calculate the total revenue but only for the state on New york and with the use of variables. So with the declaration of my measure, i have created two variables one that hepls me filter the state of New York and another one that sums the field Sales revenue. Then i returned the result of the use of the CALCULATE FUNCTION.
As you can see on the pictures the variable that sums my revenue but the one with the filter does not work. I am supposed to have 7.5 millions euros for New York's revenue. It works when i create another measure just to calculate the sum of the revenue but i rather not proceed like that for performance measures.
Does anyone please know where i went wrong?
Regards,
Tatiana
this is my DAX expression:
Solved! Go to Solution.
I think the issue is that second VAR evaluates the SUM before the filter context from the first VAR is applied, so it returns a scalar value
CALCULATE(SUM(Produits[Sales_revenue]),NewYorkSales)
should work fine
I think the issue is that second VAR evaluates the SUM before the filter context from the first VAR is applied, so it returns a scalar value
CALCULATE(SUM(Produits[Sales_revenue]),NewYorkSales)
should work fine
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.
| User | Count |
|---|---|
| 45 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |