Forum Discussion
Filter with two different measures
Hi, hope you can help me out.
I have 2 different measures, one that counts the rows from a table containing light objects, and another one that counts in a different table the heavy ones; so I want to show a visual card with the count of the light, heavy or the sum of both, depending on what's selected on the filter that comes from another table, this table has merged the light and the heavy ones with a column that indicates the type "light" or "heavy" and this is the one I want to use to use as a filter.
so far this are the measures I have and I have them in the table with the mixed data.
Light = CALCULATE(COUNTROWS(V_Light), FILTER(MixedData, MixedData[Type]))
Heavy = CALCULATE(COUNTROWS(V_heavy), FILTER(MixedData, MixedData[Type]))
Thanks in advance.
Hi garridog ,
Here we can create a measure as below.
Measure = var _sele = SELECTEDVALUE('Table'[Type]) var light = COUNTROWS(V_Light) var heavy = COUNTROWS(V_heavy) return IF(_sele = "light",light,IF(_sele= "heavy",heavy,light+heavy))Then we can get the result based on the value in slicer.
For more details, please check the pbix as attached.
Regards,
Frank
2 Replies
- v-frfei-msftCommunity Support
Hi garridog ,
Here we can create a measure as below.
Measure = var _sele = SELECTEDVALUE('Table'[Type]) var light = COUNTROWS(V_Light) var heavy = COUNTROWS(V_heavy) return IF(_sele = "light",light,IF(_sele= "heavy",heavy,light+heavy))Then we can get the result based on the value in slicer.
For more details, please check the pbix as attached.
Regards,
Frank- garridogNew Member
Hi v-frfei-msft , thanks for your reply it worked like a charm.