Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
Created a measure as below:
&
But the above measures doesn't return correct values and it is not matching my expected result.
My expected result is:
When I select the utility as gas from utility slicer, my measure should show 0.36 in table for DBName-Poind_id column
and 0.15 when we select Electricity.
We don't have to worry about Invoice Unit Rate test 2 measure showing blank values/cells and neither for Invoice Unit Rate test 3.
I am just confused how/whether to modify Invoice Unit Rate test 3 or Invoice Unit Rate test 2 measure in order to achieve above?
Can you please help achieve this result?
PFA file here Financial Management -Tanvi Copy 3 (3) (2) - Copy - Copy.pbix
Thanks in advance!
@Ahmedx @v-linyulu-msft @marcorusso @jgeddes @amitchandak @v-yaningy-msft @Greg_Deckler
Solved! Go to Solution.
Hi @sivarajan21
So on the utility you want their average, on the total you want to calculate the average for each utilities average?
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @sivarajan21
Yes, In table visuals some time total getting wrong so on that time you should create one new measure with your base measure (Invoice unit rate)
Use this measure for your scenarios
Measure=
Hi @sivarajan21
Be careful of using variables in the first part of Calculate.
Variables hold the RESULT i.e the answer/number of the calculation. This means they are not recalculated when you apply filters with DAX.
You will need to put the calculation in if you want to modify the filters.
In your example you have both Elec and Gas ticked, did you mean this? When ticked individually Rate test 3 seems to return what you want:
I will have a look at Invoice test 2
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @SamWiseOwl
Thanks for your quick response!
I will note your answer regarding variables and thanks for this info!
To answer your question 'In your example you have both Elec and Gas ticked, did you mean this? '
I ticked both. Yes when ticked individually it works and we knew that!
We want this to work, when both(Electricity & Gas) are ticked in slicer.
My expected output would be as below:
Can you please help me achieve this?
Please let me know if you need further info!
Thanks in advance!
@SamWiseOwl @v-linyulu-msft @v-yaningy-msft @Ahmedx @Greg_Deckler @jgeddes @marcorusso
Hi @sivarajan21
What is Test 3 doing/ meant to be doing?
Test 2 is working fine here:
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
If what you are trying to do is if the row would be empty return the overall calculation then it would be this:
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @SamWiseOwl ,
Thanks for your quick response!
Apologise for the confusion here!
We need both measures:
There is no problem with above measure, so please ignore it.
Now we need to work/modify on 'Invoice Unit Rate test 3' measure to make sure it calculates the average of their DBName_Point Id under their respective Utility(Electricity or Gas).
'Invoice Unit Rate test 3' measure achieves that when we select either 'Electricity' (0.15) only or 'Gas'(0.36) only from slicer. These numbers(0.15 & 0.36) are nothing but average of point id under their respective utility(Electricity/Gas).
But 'Invoice Unit Rate test 3' does not achieve that when we select both utlity in slicer as below:
It shows only 0.16 in every cell and total cell of the measure column.
My expected output is as below:
The above screenshot shows only two values(0.15 & 0.36) in every cell which is average of gas & electricity utility. The total shows average of 0.15 & 0.36 which is 0.25.For example in below screenshot
Green color highlight shows 0.15 as average for point id's that comes under electricity utility and 0.36 as average for point id's that comes under gas utility.
Please let me know if you need further information.
PFA file here Financial Management -Tanvi Copy 3 (3) (2) - Copy - Copy.pbix
Thanks in advance!
@SamWiseOwl @v-yinliw-msft @v-linyulu-msft @v-yaningy-msft @Ahmedx @marcorusso @Greg_Deckler
Hi @sivarajan21
So on the utility you want their average, on the total you want to calculate the average for each utilities average?
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @SamWiseOwl ,
This time we did it!
Thanks for your quick response & amazing solution!
This worked like a gem and i will mark it as solution!
I have given kudos as well!
Many Thanks
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
108 | |
106 | |
93 | |
69 |
User | Count |
---|---|
167 | |
132 | |
130 | |
96 | |
91 |