Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi community,
I am trying to create a measure to return the difference between two rows where the row data is from a measure. Below are the details of data model. I am looking for a solution that is a measure (or measures) rather than using several calculated columns. Any help is much appreciated.
The model has 2 tables, Table and WeightingsTable (shown below with relationship)
Below is the measure I use to derive value of our data using the weightings
DataWT = IF( HASONEVALUE('Table'[DataID]), CALCULATE(SUM('Table'[Data]) * MIN(WeightingsTable[Weighting])/100), SUMX(VALUES('Table'[DataID]), CALCULATE(SUM('Table'[Data]) * MIN(WeightingsTable[Weighting])/100)) )
I am trying to return the difference ("Delta" column) of the weighted value between the RunID and the Ref ID. (shown below). The RefID is used to indicate what RunID data to compare with.
Thanks for any assistance provided!!
Solved! Go to Solution.
Hi @Anonymous ,
You need to filter delta and let it be "is not blank".
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Firstly, make a copy of “table”.
TableC = 'Table'
Then edit relationships with WeightingsTable and table.
Create a new measure DataWT2 like DataWT based on TableC and create a new measure delta.
delta = VAR c1 = SELECTEDVALUE ( 'Table'[RefID] ) VAR c2 = SELECTEDVALUE ( 'TableC'[RunID] ) RETURN IF ( c1 = c2, [DataWT2] - [DataWT] )
At last, you can get the visual.
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I am able to return the correct values but am having trouble getting the visual to match what you have shown.
This is what I see (image).
Thoughts?
Link to PBIX use TestUpdate
Hi @Anonymous ,
You need to filter delta and let it be "is not blank".
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
139 | |
113 | |
103 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |