Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Aggregate value from a measure

Hi all,

 

I made a calculated measure that gives me a threshold for the status of our machines: 

Threshold Audit = SWITCH(TRUE(),[DateDiff Last Audit]<=14,"Green", [DateDiff Last Audit]<=39,"Amber",[DateDiff Last Audit]>=40,"Red")
 
If i just put this measure on the canvas together with the column field "machine serial", i get a line per line indication on what the machine threshold is. However, i would like to see these values aggregated, meaning, green = X, amber = Z and red = Y, and that i cannot seem to do.
 
I am using a direct query from hana, so i dont have access to the "behind the scenes" of the data source. Can anyone help me?
Thanks!
1 ACCEPTED SOLUTION

Hi @Anonymous 

 

you will have to create a separate measure for each status. I have not tested it against Hana, but it works with MS SSAS:

Amber =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( 'yourTable'[MachineID] ),
        FILTER ( 'yourTable', [DateDiff Last Audit] > 14 && [DateDiff Last Audit] > 39 )
    )
)

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , not very clear. Ate you try to put a measure on Axis ?

You have to check for binning

 

SEGMENTATION

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi amitchandak,

 

I would like the result to be displayed on a card. So, for instance, a card for Green status with the sum of all the machines that fell into green on the threshold. I currently have one calculated measure (threshold) and one column (machine serial). If i put them into the table vizualization, it works fine, but i cannot seem to get the total of machines under each of the thresholds.

 

RenataP_0-1596098851217.png

 

I read the articles you suggested, but they rely on a disconnected table or on grouping, and none of these options are possible to me due to the Hana connecton. Any other thoughts?

Hi @Anonymous 

 

you will have to create a separate measure for each status. I have not tested it against Hana, but it works with MS SSAS:

Amber =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( 'yourTable'[MachineID] ),
        FILTER ( 'yourTable', [DateDiff Last Audit] > 14 && [DateDiff Last Audit] > 39 )
    )
)

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.