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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sbuster
Helper I
Helper I

Measure result returns all rows in filter context

I have a measure [Time in State (ISO)] where I am simply trying to convert minutes to ISO8601 display format (PTxDxHxM) so i can see the duration a particulate items was in a given state.  The measure itself is working fine but I am confused as to the behavior of the visual display.  I simply have two visual tables for each data table, and when I click on Reco column it should filter State column.  The weird behvior is when debugging the measure, if I return the actual string result (r1), then resulting visual table for State display all ows, but only some rows have he proper value returned.  When the measure returns a number (like v) the filtering happens correctly.

 

 

Below is the result when I return a number from the meausre (again, just for debugging pursposes the meausre simply returns sumx(State, State[Time In State]).  The row A is selected in the left table and the right table is filtered correctly.

sbuster_0-1702995166618.png

 

This is the result when the measure returns the string value r1 and row A is selected in the left table.  Notice the right table contains all rows in State table, and only the A rows have correct value from measure.  Here I would rows for B/C not to be displayed at all.  Am I missing something in a filter context?

sbuster_1-1702995199567.png

 

 

Simplified table definitions are as follows:

Reco[ID]

State[RecoID, State, TimeInState]

 

There is a 1..Many relationship between Reco->State.

 

Measure[Time in State (ISO)]  = 

       VAR v = sumx(state,State[TimeInState])
       VAR minutesInDay = 1440
        VAR minutesInHour = 60
        VAR d1 = ROUNDDOWN(DIVIDE(v,minutesInDay),0)
        VAR d1Mod = v - (d1*minutesInDay)
        VAR h1 = ROUNDDOWN(DIVIDE(d1Mod,minutesInHour),0)
        VAR h1Mod = d1Mod - (h1*minutesInHour)
        VAR r1 = "PT"&d1&"D"&h1&"H"&h1Mod&"M"
       return r1
1 ACCEPTED SOLUTION
sbuster
Helper I
Helper I

After watching videos on data linage I believe it defintely has something to do with that, although I'm still not sure.  Closing this quesiton and opening a new one to be more specific about questions related to data linage.

View solution in original post

1 REPLY 1
sbuster
Helper I
Helper I

After watching videos on data linage I believe it defintely has something to do with that, although I'm still not sure.  Closing this quesiton and opening a new one to be more specific about questions related to data linage.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.