Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
9 | |
8 |