Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Please help
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create sample pbix file like below.
Please check the below picture and the attached pbix file.
It is one of ways for creating a measure.
expected result measure: =
SUMX (
VALUES ( data[trans_no] ),
SWITCH (
TRUE (),
CALCULATE ( COUNTROWS ( SUMMARIZE ( data, data[total_disc_amt] ) ) ) = 1
&& CALCULATE ( COUNTROWS ( data ) ) = 1, CALCULATE ( SELECTEDVALUE ( data[total_disc_amt] ) ),
CALCULATE ( COUNTROWS ( SUMMARIZE ( data, data[total_disc_amt] ) ) ) = 1, CALCULATE ( MAX ( data[total_disc_amt] ) ),
CALCULATE ( SUM ( data[total_disc_amt] ) )
)
)
Hi,
I am not sure how your semantic model looks like, but I tried to create sample pbix file like below.
Please check the below picture and the attached pbix file.
It is one of ways for creating a measure.
expected result measure: =
SUMX (
VALUES ( data[trans_no] ),
SWITCH (
TRUE (),
CALCULATE ( COUNTROWS ( SUMMARIZE ( data, data[total_disc_amt] ) ) ) = 1
&& CALCULATE ( COUNTROWS ( data ) ) = 1, CALCULATE ( SELECTEDVALUE ( data[total_disc_amt] ) ),
CALCULATE ( COUNTROWS ( SUMMARIZE ( data, data[total_disc_amt] ) ) ) = 1, CALCULATE ( MAX ( data[total_disc_amt] ) ),
CALCULATE ( SUM ( data[total_disc_amt] ) )
)
)
Just Say Wow. It does work amazingly. It took me one week crazily until this morning.
Thanks a lot.
xxx
Hi there,
I wish to share the right results I get with Measure
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 8 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 29 | |
| 24 | |
| 17 | |
| 11 | |
| 10 |