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 Team,
Please anybody help me to write DAX formula.
I have below columns
Name | EmailID | HospitalName | CityName | Date | Amount |
I need create below Checkbox
please anybody help how to create this checkbox Me mean how login ,MyHospital mean login user hosiptal
I need create Linechart x-axis is Year and Y-axis Amount
if I can select Me checck then show line in chart
if i can select MyHosital we need show line my enter hospital where I am working(example if I am working XYZ hospital only XYZ sum of amount)
if I can select myCity we need show line my city(example I am working ABC city only sum of ABC city not other city)
please anybody can help how to create checkbox based loginuser (Me),loginuser Hospital(MyHosital),login user city(Mycity).
and also need show line chart based on selection
if i am select 3 checkbox i need show 3 different lines.
Thanks
Vedantika
Solved! Go to Solution.
Hi @Anonymous ,
Maybe you can try these steps to do that.
1 Create a table named line via
Line = {"My","Myhospital","Mycity"}
2 Create there measures as the following:
My =
VAR _1 =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
[EmailID] = SELECTEDVALUE ( user[EmailID] )
&& [DATE].[Year] = YEAR ( MAX ( 'Table'[DATE] ) )
)
)
RETURN
IF (
ISFILTERED ( 'Line'[LineName] )
&& CONTAINSROW ( VALUES ( 'Line'[LineName] ), "My" ),
_1,
BLANK ()
)
MyC =
VAR _1 =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
[DATE].[Year] = YEAR ( MAX ( 'Table'[DATE] ) )
&& [CityName]
IN CALCULATETABLE (
VALUES ( 'Table'[CityName] ),
FILTER ( ALLSELECTED ( 'Table' ), [EmailID] = SELECTEDVALUE ( user[EmailID] ) )
)
)
)
RETURN
IF (
ISFILTERED ( 'Line'[LineName] )
&& CONTAINSROW ( VALUES ( 'Line'[LineName] ), "Mycity" ),
_1
)
MyH =
VAR _1 =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
[DATE].[Year] = YEAR ( MAX ( 'Table'[DATE] ) )
&& [HospitalName]
IN CALCULATETABLE (
VALUES ( 'Table'[HospitalName] ),
FILTER ( ALLSELECTED ( 'Table' ), [EmailID] = SELECTEDVALUE ( user[EmailID] ) )
)
)
)
RETURN
IF (
ISFILTERED ( 'Line'[LineName] )
&& CONTAINSROW ( VALUES ( 'Line'[LineName] ), "Myhospital" ),
_1
)
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Maybe you can try these steps to do that.
1 Create a table named line via
Line = {"My","Myhospital","Mycity"}
2 Create there measures as the following:
My =
VAR _1 =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
[EmailID] = SELECTEDVALUE ( user[EmailID] )
&& [DATE].[Year] = YEAR ( MAX ( 'Table'[DATE] ) )
)
)
RETURN
IF (
ISFILTERED ( 'Line'[LineName] )
&& CONTAINSROW ( VALUES ( 'Line'[LineName] ), "My" ),
_1,
BLANK ()
)
MyC =
VAR _1 =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
[DATE].[Year] = YEAR ( MAX ( 'Table'[DATE] ) )
&& [CityName]
IN CALCULATETABLE (
VALUES ( 'Table'[CityName] ),
FILTER ( ALLSELECTED ( 'Table' ), [EmailID] = SELECTEDVALUE ( user[EmailID] ) )
)
)
)
RETURN
IF (
ISFILTERED ( 'Line'[LineName] )
&& CONTAINSROW ( VALUES ( 'Line'[LineName] ), "Mycity" ),
_1
)
MyH =
VAR _1 =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
[DATE].[Year] = YEAR ( MAX ( 'Table'[DATE] ) )
&& [HospitalName]
IN CALCULATETABLE (
VALUES ( 'Table'[HospitalName] ),
FILTER ( ALLSELECTED ( 'Table' ), [EmailID] = SELECTEDVALUE ( user[EmailID] ) )
)
)
)
RETURN
IF (
ISFILTERED ( 'Line'[LineName] )
&& CONTAINSROW ( VALUES ( 'Line'[LineName] ), "Myhospital" ),
_1
)
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |