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
i have this table
| customer | date | transaction type | amount |
| 1 | 1/1/2022 | digital | 10 |
| 1 | 1/2/2022 | digital | 20 |
| 1 | 1/3/2022 | digital | 30 |
| 1 | 1/4/2022 | digital | 11 |
| 1 | 1/5/2022 | digital | 48 |
| 1 | 1/6/2022 | digital | 69 |
| 1 | 1/1/2022 | physical | 45 |
| 1 | 1/2/2022 | physical | 85 |
| 1 | 1/3/2022 | physical | 96 |
| 1 | 1/4/2022 | physical | 47 |
| 1 | 1/5/2022 | physical | 6 |
| 1 | 1/6/2022 | physical | 22 |
| 2 | 1/1/2022 | digital | 10 |
| 2 | 1/2/2022 | digital | 20 |
| 2 | 1/3/2022 | digital | 30 |
| 2 | 1/4/2022 | digital | 11 |
| 2 | 1/5/2022 | digital | 48 |
| 2 | 1/6/2022 | digital | 69 |
| 2 | 1/1/2022 | physical | 45 |
| 2 | 1/2/2022 | physical | 85 |
| 2 | 1/3/2022 | physical | 96 |
| 2 | 1/4/2022 | physical | 47 |
| 2 | 1/5/2022 | physical | 6 |
| 2 | 1/6/2022 | physical | 22 |
| 2 | 1/1/2022 | digital | 10 |
| 2 | 1/2/2022 | digital | 20 |
| 2 | 1/3/2022 | digital | 30 |
| 2 | 1/4/2022 | digital | 11 |
| 2 | 1/5/2022 | digital | 48 |
| 2 | 1/6/2022 | digital | 69 |
| 2 | 1/1/2022 | physical | 45 |
| 2 | 1/2/2022 | physical | 85 |
| 2 | 1/3/2022 | physical | 96 |
| 2 | 1/4/2022 | physical | 47 |
| 2 | 1/5/2022 | physical | 6 |
| 2 | 1/6/2022 | physical | 22 |
for each customer i want to calculate the ratio digital / total transactions (digital+physical) amount in the last 3 months
a customers that has ratio >0.5 (digital transactions more than 50% of his total transactions is a digital customer
I want when selecting a month form a slicer (example 01/06/2022) to count the customers of this month that have a >0.5 in the last 3 months of this selection.
Solved! Go to Solution.
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
=
COUNTROWS(
FILTER(
VALUES( TXN[customer] ),
CALCULATE(
CALCULATE( [Total], TXN[transaction type] = "digital" ) / [Total],
DATESINPERIOD( DATES[Date], MAX( DATES[Date] ), -3, MONTH )
) > .5
)
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
can the dax be modified so it shows in a card the distinct count of customers for this? (>0.5)?
To obtain the same visual effect as Card,
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
I would like to count the customers. Example 4 customers in this month had digital ratio (3 month transactions) >0.5
=
COUNTROWS(
FILTER(
VALUES( TXN[customer] ),
CALCULATE(
CALCULATE( [Total], TXN[transaction type] = "digital" ) / [Total],
DATESINPERIOD( DATES[Date], MAX( DATES[Date] ), -3, MONTH )
) > .5
)
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks worked great!
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |