Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi, I've created a table using the summarize function below
powerbi dax from this table, how do i add a new measure that shows each value as
DevicesPct = SUMMARIZE('Devices',
'Devices'[Device],
"DeviceVisits",Sum(Devices[Visits]),
"DeviceAvg",Average(Devices[Visits])/100
)
So the results look like this (After i change it on the table as % of grand total)
My question is, how do i create a card where i can drop in the details above into separate cards, but formatted in a way such as
Mobile - 56.19%
Desktop - 42.91%
So i can drop each of these into separate cards?
Any help is appreciated.
Thanks, Steve
Solved! Go to Solution.
Hi @MRUry7 ,
Hope all is going well.
Please follow these steps:
1. This is the raw data I created and the corresponding calculation sheet based on your description.
2. I created a calculated column to format "DeviceAvg" as a percentage, with the following syntax:
Avg = FORMAT( 'DevicesPct'[DeviceAvg], "Percent")
3. Then there is your need to "Mobile - 56.19% Desktop - 42.91%" format display data, I have two methods:
1)Create a measure directly. The DAX syntax is as follows. This method is simpler.
merged0 = COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg]))
2)Create a measure for each Device. The measure created by this method can be displayed through cards, but it is more troublesome.
merged1 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Mobile")
merged2 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Desktop")
merged3 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Tablet")
merged4 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Unknown")
merged5 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Gaming System")
merged6 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="TV")
Please select the method you want according to your needs.
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @MRUry7 ,
Hope all is going well.
Please follow these steps:
1. This is the raw data I created and the corresponding calculation sheet based on your description.
2. I created a calculated column to format "DeviceAvg" as a percentage, with the following syntax:
Avg = FORMAT( 'DevicesPct'[DeviceAvg], "Percent")
3. Then there is your need to "Mobile - 56.19% Desktop - 42.91%" format display data, I have two methods:
1)Create a measure directly. The DAX syntax is as follows. This method is simpler.
merged0 = COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg]))
2)Create a measure for each Device. The measure created by this method can be displayed through cards, but it is more troublesome.
merged1 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Mobile")
merged2 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Desktop")
merged3 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Tablet")
merged4 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Unknown")
merged5 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="Gaming System")
merged6 = CALCULATE(COMBINEVALUES("-", MAX('DevicesPct'[Device]), MAX('DevicesPct'[Avg])),'DevicesPct'[Device]="TV")
Please select the method you want according to your needs.
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Thanks very much. This seems to be what i was looking for.