Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
So I have a fact table with data per ID for different metrics. I have a measure that calculates the proportions based on the data in the fact table. This fact table also has a column for 2020 Current, Budget 2020, and Variation 2020 to the Budget named Year Type.
I have another table that groups IDs by country.
I'm creating a matrix with Country as the top level in columns and Year type as the second level in columns. Then all my measurement proportions are values that are displayed as rows.
Therefore, it would show US as a top-level column, and then the column level below would be 2020 Current, 2020 Budget, and 2020 Variation to Budget.
This works well, but the deviation to the budget is misleading. The calculation works correctly, but the variance must be calculated differently. Here's an example of my data:
So you can see in the ratio column that the measure would correctly calculate for deviation (Earnings/Price), however, the result is not correct. Must be 25%-10%.
I need my data structured as Country at Level 1 for Columns and Year Type for Level 2 in a matrix. I can try to create a measure that makes the variance as set above (25%-10%), or if I could leave the result blank because the current result is a bit misleading.
Solved! Go to Solution.
Hi @Anonymous ,
Can you try the following measure
Ratio =
VAR _earnings = calculate(sum(myTable[Amount]),Account="Price")
VAR _price = calculate(sum(myTable[Amount]),Account="Earnings")
RETURN
if(Account="Earnings",
DIVIDE(_earnings,_price),
BLANK()
)
Hi @Anonymous ,
Can you try the following measure
Ratio =
VAR _earnings = calculate(sum(myTable[Amount]),Account="Price")
VAR _price = calculate(sum(myTable[Amount]),Account="Earnings")
RETURN
if(Account="Earnings",
DIVIDE(_earnings,_price),
BLANK()
)
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |