March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I would like to comibine the following two mesures (Average / SUM) based on county:
IF
data_merged[crashid]="LEA"
then
Solved! Go to Solution.
Hi @Anonymous ,
If you already have the two measure calculated you just need to do the following code:
IF (SELECTEDVALUE(data_merged[crashid])="LEA" , crashdeathcount_agg , crashdeathcount_agg )
If you don't have the measures separated you should do:3
Measure = IF ( data_merged[crashid] = "LEA", crashdeathcount_agg = SUMX ( DISTINCT ( data_merged[crashid] ), CALCULATE ( AVERAGE ( data_merged[crashdeathcount] ) ) ), crashdeathcount_agg = SUMX ( DISTINCT ( data_merged[crashid] ), CALCULATE ( SUM ( data_merged[crashdeathcount] ) ) ) )
Without any data and specif details on your data model is difficult to give you a better answer.
If this doesn't wqork can you share a sample data and expected result.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi,
Drag CrashID to the row labels of your Table visual and write this measure
=IF(HASONEVALUE(data_merged[crashid]),IF(VALUES(data_merged[crashid])="LEA",SUMX(DISTINCT(data_merged[crashid]),CALCULATE(AVERAGE(data_merged[crashdeathcount]))),SUMX(DISTINCT(data_merged[crashid]),CALCULATE(SUM(data_merged[crashdeathcount])))),BLANK())
Hope this helps.
Hi @Anonymous ,
If you already have the two measure calculated you just need to do the following code:
IF (SELECTEDVALUE(data_merged[crashid])="LEA" , crashdeathcount_agg , crashdeathcount_agg )
If you don't have the measures separated you should do:3
Measure = IF ( data_merged[crashid] = "LEA", crashdeathcount_agg = SUMX ( DISTINCT ( data_merged[crashid] ), CALCULATE ( AVERAGE ( data_merged[crashdeathcount] ) ) ), crashdeathcount_agg = SUMX ( DISTINCT ( data_merged[crashid] ), CALCULATE ( SUM ( data_merged[crashdeathcount] ) ) ) )
Without any data and specif details on your data model is difficult to give you a better answer.
If this doesn't wqork can you share a sample data and expected result.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
105 | |
98 | |
65 | |
54 |