Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
So i have a data set composed of
Table transactions:
id transaction / | station / | amount / | date |
Table Station:
Station / | Location / | Country |
And Table Date
I can visualise in a Matrix how many transactions per station per time(month, year, day ,week... ).
Using the function number of transactions (NbreTransactions N = COUNTX(Tbl_Transactions,Tbl_Transactions[ID Transaction]))
The visualition looks like this:
Station | month 1 | month 2 | month 3 |
A | 50 | 55 | 100 |
B | 0 | 2 | 6 |
C | 1 | 100 | 0 |
Morover i have edited the visual So that the number appear in colors based on the category ( green >5 yellow >0 and red=0). You get the idea.
My problem is I want a visual where i can track the number of stations by Number of transaction per period by category.
I want the final result in a stacked histogram.
For the table above Example :
month 1 the stacked histogram divided into 3 part where it shows 1/3 red 1/3 yellow 1/3 green.
month 2 the stacked histogram divided into 2 part where it shows 1/3 yellow 2/3 green.
month 3 the stacked histogram divided into 2 part where it shows 1/3 red 2/3 green.
I'm really lost any help is appreciated.
Thank you.
Solved! Go to Solution.
Hi ,
Is this you want?
If yes, please follow these steps to do.
1 Create a color table via
Table = {("RED",1),("GREEN",3),("YELLOW",2)}
2 Create a measure:
measure =
VAR _S =
SUMMARIZE ( 'FACT TABLE', [Station], "COUNT", [NbreTransactions N] )
VAR _R =
COUNTROWS ( FILTER ( _S, [COUNT] = 0 ) ) + 0
VAR _Y =
COUNTROWS ( FILTER ( _S, [COUNT] > 0 && [COUNT] < 5 ) ) + 0
VAR _G =
COUNTROWS ( FILTER ( _S, [COUNT] > 5 ) ) + 0
RETURN
SWITCH ( SELECTEDVALUE ( 'Table'[Color] ), "RED", _R, "YELLOW", _Y, _G )
3 Create a visual and put this measure in y-axis, month in x-axis and color in legend.
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 ,
Is this you want?
If yes, please follow these steps to do.
1 Create a color table via
Table = {("RED",1),("GREEN",3),("YELLOW",2)}
2 Create a measure:
measure =
VAR _S =
SUMMARIZE ( 'FACT TABLE', [Station], "COUNT", [NbreTransactions N] )
VAR _R =
COUNTROWS ( FILTER ( _S, [COUNT] = 0 ) ) + 0
VAR _Y =
COUNTROWS ( FILTER ( _S, [COUNT] > 0 && [COUNT] < 5 ) ) + 0
VAR _G =
COUNTROWS ( FILTER ( _S, [COUNT] > 5 ) ) + 0
RETURN
SWITCH ( SELECTEDVALUE ( 'Table'[Color] ), "RED", _R, "YELLOW", _Y, _G )
3 Create a visual and put this measure in y-axis, month in x-axis and color in legend.
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.
Thank you and have a nice day.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |