Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi all,
I'm just learning PowerBI and Dax and working on my first project...
I came up with an issue with two measures, doing a sum if an order has a certain state. To exclude any issue with my data model, I made a simple example to solve the issue but I ran into the same problem.
I have this simple table:
So I want the revenue for type A, I made a measure: Revenue A = CALCULATE(SUM('order'[Revenue]), 'order'[Type] = "A")
The same for order type B.
Putting the measure on a KPI visual or a table visual works fine. Putting both measuares on the table visual I am receivang an error.
Summing up both measures (Revenue AB = [Revenue A] + [Revenue B] gives me the same error on the KPI visual.
Maybe that's just a simple newbie problem, any hint is highly appreciated.
Thanks
Andreas
have found i have this exact issue sample pibx from @tharunkumarRTK also gives error same as @Andreas112
i am running Version: 2.139.2054.0 32-bit (January 2025)
Hi @Andreas112 ,
I'm the same as yours, but I reproduced it on my side, and there were no problems.
Have you tried rebuilding every visual with the error to see if they work fine?
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-stephen-msft ,
I tried rebuilding everything several times, also testing with older versions.
At this point September Version: 2.136.1478.0 32-bit (September 2024) works fine, October and November show the same error.
Best Regards
Andreas
Hi @Andreas112 ,
Using the KEEPFILTERS function ensures that the filter 'order'[Type] = "A" is applied in addition to any existing filters on the Type column, rather than replacing them. If a slicer or other visual already filters the data, this measure will respect those filters, making it more dynamic.
Revenue A = CALCULATE(SUM('order'[Revenue]), KEEPFILTERS('order'[Type] = "A"))
If you use the required field in the KPI visual, the visual will display correctly. For example, adding the measure Revenue AB = [Revenue A] + [Revenue B] to the Value (Indicator) field ensures the visual has the necessary input to render.
Having said that, for the case described above, using the order[Type] field on rows, combined with slicers, would be sufficient without the need to write separate measures for each order type.
I have attached an example pbix file for your reference.
Best regards,
Best regards,
Not sure if there is any gap in my understanding, But it should not give any error if you have created the measures with the correct syntax and if you would have chossen appropriate data types then it should not give any error. For your reference I created the sample report with the data you provided and created the same measures
I am attaching the PBIX for your reference
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
|
Thanks for your answer.
I opened your pbix and got the same errors. Same with @DataNinja777 pbix....
I am working an PowerBI Desktop Version: 2.138.1452.0 32-bit (November 2024)
Could this be a problem with my options and settings?
Thanks
Andreas
Strange, I have the same version installed in my machine. May be install the older version and see if that helps
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
|
I installed March version and everything works as expected.
I again downloaded November version, installed it and it doesn't work anymore....really strange.
As a workaround I can go back to the March version, hoping that with the next update it will work again.
Thanks for your kind help.
Andreas
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
98 | |
63 | |
46 | |
36 | |
34 |