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.
Hi Folks,
I have a matrix visualization that uses a UNICHAR(10003) character to validate whether there is data or not in specific countries by Test (see image). The issue is with the totals where instead of a count of the data (with a number), it has the UNICHAR character as well. I don't see where i can change the type of data in the total to make it a count.
Can someone help turn the total in a numerical sum? Thanks!
Rui
Solved! Go to Solution.
Hi @rflora
Do the Test1... Test3 come from another hierarchy column (assume it is called "Test") in your table? If so, try below measure:
New measure 3 =
VAR unirows =
CALCULATE (
DISTINCTCOUNT ( 'TestData'[Value] ),
FILTER ( 'TestData', NOT ( ISBLANK ( [Measure1] ) ) )
)
RETURN
IF (
ISINSCOPE ( 'TestData'[Test] ) && ISINSCOPE ( 'TestData'[City] ),
[Measure1],
unirows
)
What is the measure you are using for the UNICHAR?
You could try:
New measure with totals =
VAR unirows =
CALCULATE (
COUNTA ( Table[Country] ),
FILTER ( Table, NOT ( ISBLANK ( [your UNICHAR measure] ) ) )
)
RETURN
IF ( ISINSCOPE ( Table[Country] ), [your UNICHAR Measure], unirows )
Proud to be a Super User!
Paul on Linkedin.
Measure 2 = var a= COUNT(Merge1[Source Value]) return IF(ISBLANK(a),BLANK(),unichar(10003))
This is how my measure is built. How could it be twicked?
Apologies but i don't have much knowledge in DAX.
Try this measure:
New measure with totals =
VAR unirows =
CALCULATE (
COUNTA ( Table[Country] ),
FILTER ( Table, NOT ( ISBLANK ( [measure 2] ) ) )
)
RETURN
IF ( ISINSCOPE ( Table[Country] ), [measure 2], unirows )
(where [measure 2] is the measure you currently have). Remove your [measure 2] from the visual and use this [New measure with totals].
Proud to be a Super User!
Paul on Linkedin.
New measure with totals =
VAR unirows =
CALCULATE (
DISTINCTCOUNT('Test table'[Source Value] ),
FILTER ('Test table', NOT ( ISBLANK ( [measure] ) ) )
)
RETURN
IF ( ISINSCOPE ( 'Test table'[Region]), [measure], unirows )
@PaulDBrown Thanks! I made a few changes to get closer to what i need. I added a distinct count since I have many different entries in my DB and also i updated the return to be the "Region" which is the higher level, making the total by test accurate.
The only thing missing now is to have the grand total by country as well:
Essentially i should have "1" in the blue arrows and "3" in the red arrows
Hi @rflora
Do the Test1... Test3 come from another hierarchy column (assume it is called "Test") in your table? If so, try below measure:
New measure 3 =
VAR unirows =
CALCULATE (
DISTINCTCOUNT ( 'TestData'[Value] ),
FILTER ( 'TestData', NOT ( ISBLANK ( [Measure1] ) ) )
)
RETURN
IF (
ISINSCOPE ( 'TestData'[Test] ) && ISINSCOPE ( 'TestData'[City] ),
[Measure1],
unirows
)
Works perfectly! Thanks a mil.
@rflora , use is in scope and return formatted number, as datatype this measure is test
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |