Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have an order table from where I would like to shor percentage of claim vs. all orders.
I have a claim colum and a colum for a complete sale (date).
Claim colum contains:
Null on the majority of orders
1 - Claim type 1
2 - Claim type 2
0 (error from db, so 0 i actually a normal order and should have null value.
When I do a diagram I want in each bar (per store) to show all orders (all blanks (null)) and status 0, as those are normal orders. Then I want to show how big a part status 1 and 2 are of the total orders. But as all sales are null, those with 0 is seen as a claim. If I filter 0 away then I see the actual claim, but I miss the rows with 0 on total amount of orders.
In Query Editor I cannot change 0 to Null
Any suggestions?
When using calculate be sure to filter to 0 as well as "" for the null values. Put your measures in seperately. Depending on how you want to create your measures You could start with a simple Count like:
Total Claim Type 2 = CALCULATE(COUNT(Fact[Claim]), Fact[Claim]=1) Which would give you a count of claims where the claim type is 1. You would need a count of all claims: Total All Claims = COUNT(Fact[Claim]).
Then use Divide with those two measures: % Type 1 = DIVIDE([Total Claim Type 2], [Total All Claims]).
Of course, from your post, it is difficult to imagine the actual data formats. You may want to use SUM. I was making an assumption that claim referred to a claim type reference. If you have different fields, the calculations would be different. For example, if you have sales totals in a sales total column it might be something more along the lines of =CALCULATE(SUM(Fact[Sales]), Fact[Claim]=1) to calculate the total sales amount of sales lines with claim type of 1.
Can you post a bit of data to work with?
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |