Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi all,
data for use below:-
Sub | data of sub |
| A | 1 |
| B | 2 |
| C | 3 |
| A | 4 |
| B | 5 |
| C | 6 |
| A | 7 |
| B | 8 |
| C | 9 |
| A | 10 |
| B | 11 |
| C | 12 |
| A | 13 |
| B | 14 |
| C | 15 |
| A | 16 |
| B | 17 |
| C | 18 |
| A | 19 |
| B | 20 |
| C | 21 |
Without using slicer measure working good........
using slicer also dax working fine.......
But when i select data of sub why it's showing true....
Is it any solution of this when I select data of sub. It show false........
Regards,
NICK
Solved! Go to Solution.
This is indended behaviour. Your measure is checking if the selected value is the same as the first value. The reason why when you select a value it shows true is that the value you are selecting is filtering your measure down to the sub that it is a part of. Then the selected sub is the same as the first one as there is only one sub in the current context.
In ecessence your table is a filter. To fix this the quick and dirty way is to disable the relationship between the two visuals. A way to do it in DAX would be to use ALL so that you cant filter the measure using data of sub. There might be a better way to do it but this does work.
Measure =
CALCULATE (
IF (
FIRSTNONBLANK ( table1[Sub], Table1[Sub] ) = SELECTEDVALUE ( Table1[Sub] ),
"true",
"false"
),
ALL ( Table1[data of sub] )
)
This is indended behaviour. Your measure is checking if the selected value is the same as the first value. The reason why when you select a value it shows true is that the value you are selecting is filtering your measure down to the sub that it is a part of. Then the selected sub is the same as the first one as there is only one sub in the current context.
In ecessence your table is a filter. To fix this the quick and dirty way is to disable the relationship between the two visuals. A way to do it in DAX would be to use ALL so that you cant filter the measure using data of sub. There might be a better way to do it but this does work.
Measure =
CALCULATE (
IF (
FIRSTNONBLANK ( table1[Sub], Table1[Sub] ) = SELECTEDVALUE ( Table1[Sub] ),
"true",
"false"
),
ALL ( Table1[data of sub] )
)
Hi @Anonymous,
Thanks for fast reply.
it resolve my 50% query but one more issue can you resolve,
if I select both(sub and data of sub) then how i get false.
thanks in advance
Regards,
NICK
To do this I just added a check for if there is one value in both sub and data of sub. There might be a better solution depending on the structure of your data but this does work.
Measure 3 =
IF (
HASONEVALUE ( Table1[Sub] ) && HASONEVALUE ( Table1[data of sub] ),
"false",
CALCULATE (
IF (
FIRSTNONBLANK ( table1[Sub], Table1[Sub] ) = SELECTEDVALUE ( Table1[Sub] ),
"true",
"false"
),
ALL ( Table1[data of sub] )
)
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |